package com.micro.common.biz;

/**
 * @author LevelCoder
 * @version V1.0.0
 * @email LevelCoder@126.com
 * @date 2020/8/4
 */
public class TokenCacheKeyUtil {

    /**
     * 缓存刷新redis key
     */
    public static final String REDIS_REFRESH_TOKEN_KEY = "MICRO:TOKEN:REFRESH:";

    public static final String REDIS_ACCRESS_TOKEN_KEY = "MICRO:TOKEN:ACCRESS:";

    /**
     * 根据客户编号生成redis key : 缓存刷新token
     * @param customerCode
     * @return
     */
    public static String getRefreshTokenKey (String customerCode,String clientType) {
        return REDIS_REFRESH_TOKEN_KEY + clientType+":"+customerCode ;
    }

    /**
     * 根据客户编号生成redis key : 请求token
     * @return
     */
    public static String getAccressTokenKey(String customerCode,String clientType){
        return REDIS_ACCRESS_TOKEN_KEY + clientType+":" + customerCode;
    }
}
